package com.dongxing.concyrrency.chapter6;

import java.util.concurrent.TimeUnit;

/**
 * @author XavierDong
 **/
public class ThreadCodeForce {
    public static void main(String[] args) {
        ThreadService service = new ThreadService();
        Long start = System.currentTimeMillis();

        service.execute(() -> {
            // load a very heavy resource.
/*            while (true) {


            }*/
            try {
                TimeUnit.SECONDS.sleep(5);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });

        service.shutdown(10000L);
        Long end = System.currentTimeMillis();
        System.out.println(end - start);
    }

}
